package com.alibaba.nacos.console.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

import static java.lang.Boolean.TRUE;

@ConfigurationProperties(prefix = "dist.dasc.filter.http")
public class HttpSecurityProperties {

    String cspValue = "default-src 'self' "
        + "data: web.zjj.sz.gov.cn zjj.sz.gov.cn dev.dist.com.cn; "
        + "object-src 'unsafe-inline' 'unsafe-eval' 'self' web.zjj.sz.gov.cn  zjj.sz.gov.cn dev.dist.com.cn; "
        + "script-src 'self'  data: 'unsafe-inline' 'unsafe-eval' web.zjj.sz.gov.cn  zjj.sz.gov.cn dev.dist.com.cn;"
        + "style-src 'self' data: 'unsafe-inline' web.zjj.sz.gov.cn  zjj.sz.gov.cn dev.dist.com.cn";

    boolean cspEnabled = TRUE;

    String allowedUrls = "web.zjj.sz.gov.cn  zjj.sz.gov.cn dev.dist.com.cn";

    boolean frameOptionsEnabled = TRUE;

    String frameOptionsHeaderValue = "SAMEORIGIN";

    boolean contentTypeOptionsEnabled = TRUE;

    boolean xssProtectionEnabled = true;

    String xssProtectionEscapeChars = "";

    boolean strictTransportSecurityEnabled = TRUE;

    String allowedMethods = "HEAD OPTIONS GET POST PUT PATCH DELETE";

    boolean cookieHttpOnly;

    public String getCspValue() {
        return cspValue;
    }

    public void setCspValue(String cspValue) {
        this.cspValue = cspValue;
    }

    public boolean isCspEnabled() {
        return cspEnabled;
    }

    public void setCspEnabled(boolean cspEnabled) {
        this.cspEnabled = cspEnabled;
    }

    public String getAllowedUrls() {
        return allowedUrls;
    }

    public void setAllowedUrls(String allowedUrls) {
        this.allowedUrls = allowedUrls;
    }

    public boolean isFrameOptionsEnabled() {
        return frameOptionsEnabled;
    }

    public void setFrameOptionsEnabled(boolean frameOptionsEnabled) {
        this.frameOptionsEnabled = frameOptionsEnabled;
    }

    public String getFrameOptionsHeaderValue() {
        return frameOptionsHeaderValue;
    }

    public void setFrameOptionsHeaderValue(String frameOptionsHeaderValue) {
        this.frameOptionsHeaderValue = frameOptionsHeaderValue;
    }

    public boolean isContentTypeOptionsEnabled() {
        return contentTypeOptionsEnabled;
    }

    public void setContentTypeOptionsEnabled(boolean contentTypeOptionsEnabled) {
        this.contentTypeOptionsEnabled = contentTypeOptionsEnabled;
    }

    public boolean isXssProtectionEnabled() {
        return xssProtectionEnabled;
    }

    public void setXssProtectionEnabled(boolean xssProtectionEnabled) {
        this.xssProtectionEnabled = xssProtectionEnabled;
    }

    public String getXssProtectionEscapeChars() {
        return xssProtectionEscapeChars;
    }

    public void setXssProtectionEscapeChars(String xssProtectionEscapeChars) {
        this.xssProtectionEscapeChars = xssProtectionEscapeChars;
    }

    public boolean isStrictTransportSecurityEnabled() {
        return strictTransportSecurityEnabled;
    }

    public void setStrictTransportSecurityEnabled(boolean strictTransportSecurityEnabled) {
        this.strictTransportSecurityEnabled = strictTransportSecurityEnabled;
    }

    public String getAllowedMethods() {
        return allowedMethods;
    }

    public void setAllowedMethods(String allowedMethods) {
        this.allowedMethods = allowedMethods;
    }

    public boolean isCookieHttpOnly() {
        return cookieHttpOnly;
    }

    public void setCookieHttpOnly(boolean cookieHttpOnly) {
        this.cookieHttpOnly = cookieHttpOnly;
    }
}

